package br.com.connection;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class ConnectionFactory {

	private static Connection con = null;
	
	public Connection getConnection() throws Exception {

		Class.forName("org.postgresql.Driver");
		String url = "jdbc:postgresql://localhost:5432/oscontrol";

		String user = "postgres";
		String passoword = "123";

		try {

			Connection con = DriverManager.getConnection(url, user, passoword);
			con.setAutoCommit(false);
			return con;

		} catch (SQLException e) {
			System.out.println("falha na conexão!!!");
			throw new RuntimeException(e);

		}
	}
}
